﻿<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" CodeBehind="Edit.aspx.cs"
    Inherits="Forum.Web.Admin.KeyWord.Edit" %>

<%@ Register Assembly="Editor2" Namespace="Editor2" TagPrefix="cc1" %>
<%@ Register Assembly="Public.Control" Namespace="Public.Control" TagPrefix="cc11" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../styles/dntmanager.css" rel="stylesheet" type="text/css" />
    <link href="../styles/modelpopup.css" rel="stylesheet" type="text/css" />
</head>
<script src="../js/common.js" type="text/javascript"></script>
<script src="../js/public.js" type="text/javascript"></script>

<script src="../js/HBDivBox.js" type="text/javascript"></script>
<script src="../js/modalpopup.js" type="text/javascript"></script>
<body class="ContentBody" style="margin: 0px; padding: 0px; font-size: 12px;">
    <div id="neworedit" style="border-right: #999 1px solid; padding-right: 10px; border-top: #999 1px solid;
        display: none; padding-left: 10px; background: #fff; padding-bottom: 10px; border-left: #999 1px solid;
        width: 250px; padding-top: 10px; border-bottom: #999 1px solid">
        <table width="250" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td align="center" height="100">
                    <img alt="" src="../images/spinner.gif" align="absmiddle" />
                    数据载入中...
                </td>
            </tr>
        </table>
    </div>
    <form id="form2" runat="server" style="display:none;">

    <script type="text/javascript">
        function hidediv0() {
            HBDivBox.time = 9999999;
            HBDivBox.Show2("neworedit");
        }
        hidediv0();
    </script>

    <cc11:Hint ID="Hint1" runat="server" HintImageUrl="../images" />
    <table width="100%" border="0" cellpadding="0" cellspacing="0" style="width: 100%;
        padding-right: 5px;">
        <tr>
            <td height="40" align="right" style="padding-right: 5px">
                标题:
            </td>
            <td>
                &nbsp;<cc11:TextBox ID="f_name" HintInfo="英文汉字均可,不能为空" runat="server" Width="210px"
                    HintShowType="down"></cc11:TextBox>&nbsp;&nbsp;&nbsp;
                <cc11:Button ID="Button1" runat="server" AutoPostBack="False" ButtonImgUrl="../images/check_1.gif"
                    Text=" 保存内容" ValidateForm="False" ScriptContent="save()" />&nbsp;&nbsp;
                <button type="button" class="ManagerButton" id="Button3" onclick="showdata(<%=id_ %>)">
                    <img src="../images/topictype.gif" />转入库中</button>
                &nbsp;&nbsp;
                <button type="button" class="ManagerButton" id="Button8" onclick="del_date(<%=id_ %>)">
                    <img src="../images/false.gif" />删除</button>
                <cc11:Button ID="Button6" runat="server" ButtonImgUrl="../images/del.gif" Text=" 取 消"
                    AutoPostBack="False" ScriptContent="window.parent.BOX_remove('neworedit');" />
            </td>
        </tr>
        <tr>
            <td height="40" align="right">
                描述:
            </td>
            <td height="50" style="padding: 5px">
                <cc11:TextBox ID="f_shuoming" HintInfo="对主内容的简短说明,120个汉字以内" runat="server" Width="99%"
                    Height="50px" TextMode="MultiLine" HintShowType="down"></cc11:TextBox>
            </td>
        </tr>
        <tr id="yc_0">
            <td height="40" align="right">
                内容:
            </td>
            <td height="50" style="padding: 5px">
                <cc1:HtmlEditor ID="HtmlEditor1" runat="server" Width="99%" Height="275px" ResourcesPath="/htmledit/">
                </cc1:HtmlEditor>
            </td>
        </tr>
        <tr id="z_fl">
            <td height="40" align="right">
                &nbsp;
            </td>
            <td height="50">
                <div class="Navbutton">
                    <cc11:Button ID="Button4" runat="server" AutoPostBack="False" ButtonImgUrl="../images/check_1.gif"
                        Text=" 保存内容" ValidateForm="False" ScriptContent="save()" />&nbsp;&nbsp;
                    <button type="button" class="ManagerButton" id="Button2" onclick="showdata(<%=id_ %>)">
                        <img src="../images/topictype.gif" />转入库中</button>&nbsp;&nbsp;
                    <button type="button" class="ManagerButton" id="Button7" onclick="del_date(<%=id_ %>)">
                        <img src="../images/false.gif" />删除</button>
                    &nbsp;&nbsp;
                    <cc11:Button ID="Button5" runat="server" ButtonImgUrl="../images/del.gif" Text=" 取 消"
                        AutoPostBack="False" ScriptContent="document.getElementById('form2').style.display ='none';window.parent.BOX_remove('neworedit');" />
                </div>
            </td>
        </tr>
    </table>

    <script type="text/javascript">
var id_=<%=id_ %>;
    function showdata(myid) {
        Forum.Web.Admin.KeyWord.Edit.addrk(myid, function(res) {
            if (res && res.value) {
                //alert("已经入库");
                

                window.parent.hide(myid);
                //window.parent.location.reload();
            }
        });
    }
    
    function del_date(myid) {
        var tf_tf = window.confirm('您确定要删除选择的信息?');
        if (tf_tf) {
            Forum.Web.Admin.KeyWord.Edit.Del(myid, function(res) {
                if (res && res.value) {
                    if (res.value == 1) {
                        //alert("操作成功");

                        window.parent.hide(myid);
                        //window.parent.location.reload();
                    }
                }
            });
        }
    }
    
    function save()
    {
        var title=hbctl_.GetValueByID("f_name");
        var sm=hbctl_.GetValueByID("f_shuoming");
        var html=RIfrBodyHtml();
        
        if(title.length<1)
        {
            alert("请输入标题");
            return false;
        }
        if(html.length<20)
        {
            alert("信息内容太少!");
            return false;
        }
        Forum.Web.Admin.KeyWord.Edit.save(id_, title, sm, html,function(res){
            //alert(res.value);
            if(res && res.value)
            {
                //alert("操作成功!");
                window.location.reload();
            }
        });
    }
    
    function showdiv0()
    {
        HBDivBox.Remove2("neworedit");
        document.getElementById("form2").style.display = "block";
    }
    showdiv0();
    </script>

    </form>
</body>
</html>
